using MicroMsg.Manager;
using MicroMsg.Plugin;
using MicroMsg.Resource.@string;
using MicroMsg.UI.Util;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
namespace MicroMsg.UI.UserContrl
{
	public class DriftBottlePluginSetCtrl : PluginSettingBaseCtrl
	{
		internal Grid LayoutRoot;
		internal Button btnGotoBtl;
		internal Button btnClearMsg;
		private bool _contentLoaded;
		public static DriftBottlePluginSetCtrl GetInstance()
		{
			return new DriftBottlePluginSetCtrl();
		}
		public DriftBottlePluginSetCtrl()
		{
			this.InitializeComponent();
			base.add_Loaded(new RoutedEventHandler(this.DriftBottlePluginSetCtrl_Loaded));
		}
		private void DriftBottlePluginSetCtrl_Loaded(object sender, RoutedEventArgs e)
		{
		}
		public override void Exit()
		{
			base.Exit();
		}
		private void btnSetHead_Click(object sender, RoutedEventArgs e)
		{
			ToolFunction.GotoPageForUserControl("/Source/Plugin/DriftBottle/UI/SetDriftBottleHead.xaml", null, false);
		}
		private void btnGotoBtl_Click(object sender, RoutedEventArgs e)
		{
			PluginBase pluginBase = ExtentCenter.findPluginByID(32769L);
			if (pluginBase != null)
			{
				pluginBase.execute(4, null);
			}
		}
		private void btnClearMsg_Click(object sender, RoutedEventArgs e)
		{
			MMMessageBox mMMessageBox = MMMessageBox.Show(strings.Plugin_ClearPluginMessage, null, true, strings.COM_Confirm, strings.COM_Cancel);
			mMMessageBox.ReturnEvent = new DlgReturnEvent(this.OnClearQQMsgHandler);
		}
		private void OnClearQQMsgHandler(DlgReturnEventArg dlgReturnEventArg_0)
		{
			switch (MMMessageBox.GetUserClickResult(dlgReturnEventArg_0))
			{
			case 0:
				BConversationMgr.DriftBottleClearAll();
				break;
			case 1:
				break;
			default:
				return;
			}
		}
		[DebuggerNonUserCode]
		public void InitializeComponent()
		{
			if (this._contentLoaded)
			{
				return;
			}
			this._contentLoaded = true;
			Application.LoadComponent(this, new Uri("/MicroMsg;component/Source/Plugin/DriftBottle/UI/DriftBottlePluginSetCtrl.xaml", 2));
			this.LayoutRoot = (Grid)base.FindName("LayoutRoot");
			this.btnGotoBtl = (Button)base.FindName("btnGotoBtl");
			this.btnClearMsg = (Button)base.FindName("btnClearMsg");
		}
	}
}
